import { http } from "@/utils/http";
type Result = {
  current_page: number;
  result?: any;
  per_page?: number;
  total?: number;
  data?: any;
};
type ResultCreate = {
  code: number;
  msg: string;
  result: any;
};
type Show = {
  code: number;
  msg: string;
  result?: any;
};
/** 设备列表 */
export const getDeviceListApi = (params?: object) => {
  return http.request<Result>("get", "/dashboard/device/list", {
    params
  });
};
/** 设备创建 */
export const createDeviceApi = (data?: object) => {
  return http.request<ResultCreate>("post", "/dashboard/device/store", {
    data
  });
};
/** 设备修改 */
export const updateDeviceApi = (data?: object) => {
  return http.request<ResultCreate>("put", "/dashboard/device/update", {
    data
  });
};
/** 设备删除 */
export const delDeviceApi = (data?: object) => {
  return http.request<ResultCreate>("delete", "/dashboard/device/delete", {
    data
  });
};
/** 设备详情 */
export const getDeviceShowApi = (params?: object) => {
  return http.request<Show>("get", "/dashboard/device/show", {
    params
  });
};
/** 设备状态 */
export const updateStatusApi = (data?: object) => {
  return http.request<ResultCreate>("put", "/dashboard/device/updateStatus", {
    data
  });
};
/** 设备日志列表 */
export const getDeviceLogListApi = (params?: object) => {
  return http.request<Result>("get", "/dashboard/deviceDispatchLog/list", {
    params
  });
};
/** 设备日志删除 */
export const delDeviceLogApi = (data?: object) => {
  return http.request<ResultCreate>("delete", "/dashboard/deviceDispatchLog/delete", {
    data
  });
};
/** 设备日志详情 */
export const getDeviceLogShowApi = (params?: object) => {
  return http.request<Show>("get", "/dashboard/deviceDispatchLog/show", {
    params
  });
};